package org.example.app.config;

import org.example.app.config.aot.MybaitsRuntimeHintsRegistrar;
import org.example.app.config.aot.MybatisBeanFactoryInitializationAotProcessor;
import org.example.app.config.aot.MybatisMapperFactoryBeanPostProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportRuntimeHints;

@Configuration(proxyBeanMethods = false)
@ImportRuntimeHints(MybaitsRuntimeHintsRegistrar.class)
public class MybatisNativeConfig {

    @Bean
    MybatisBeanFactoryInitializationAotProcessor createMybatisBeanFactoryInitializationAotProcessor() {
        return new MybatisBeanFactoryInitializationAotProcessor();
    }

    @Bean
    static MybatisMapperFactoryBeanPostProcessor createMybatisMapperFactoryBeanPostProcessor() {
        return new MybatisMapperFactoryBeanPostProcessor();
    }

}
